import request from '@/request'

export function getUserInfo(token) {
  return request({
    headers: {
      'apiToken': token
    },
    url: '/user/currentUser',
    method: 'get'
  })
}

export function mineInfo(token) {
  return request({
    headers: {
      'apiToken': token
    },
    url: '/user/mineCard',
    method: 'post'
  })
}

export function changeNickName(editUserReq) {
  return request({
    url: '/user/editNickName',
    method: 'post',
    data: {
      nickName: editUserReq.nickName
    }
  })
}

export function sendEmailSms() {
  return request({
    url: '/user/sendEmail',
    method: 'post'
  })
}

export function changePassword(editUserReq) {
  return request({
    url: '/user/editPassword',
    method: 'post',
    data: {
      password: editUserReq.password,
      emailCode: editUserReq.emailCode
    }
  })
}